<?php 
/*
 module:		首页
 create_time:	2021-09-18 22:56:53
 author:		
 contact:		
*/

namespace app\api\controller;

use app\api\service\UrlballbackService;
use utils\weixinpay\wechatpay;


class Urlballback{




    public function wxnotify()
    {
        // 导入微信支付sdk
        $wxpay  =new wechatpay();
        $result = $wxpay->notify();
//        $myfile = fopen("newfile.txt", "w") or die("Unable to open file!");
//        $txt = json_encode($result,true);
//        fwrite($myfile, $txt);
//        fclose($myfile);
        if ($result) {
            // 验证成功 修改数据库的订单状态等 $result['out_trade_no']为订单id
            UrlballbackService::wxnotify($result);
//$this->success('支付成功', U('order/mlist', array('orderno' =>$result['out_trade_no'])));
        }
    }




















































}

